<?php
include('../../include/functions.inc.php');
?>
<?php //require_once('Conection_DataBase.php') ?>
<?php
//mysql_select_db(DBNAME, $jssue);

$Usue = $_GET['PERFIL'];

$opts = $db->query_toArray("select * from cllg_acces where FK_PERFIL=$Usue");
if (count($opts) == 0) {
    $Querry_recordSet12 = "select * from cllg_menu";
    $recordset12 = mysql_query($Querry_recordSet12) or die(mysql_error());
    while ($pruebaAcces = mysql_fetch_assoc($recordset12)) {
        $fkmenu = $pruebaAcces["ID"];
        $QuerryInsert23 = "Insert Into cllg_acces (FK_MENU,FK_PERFIL) values ('$fkmenu', '$Usue')";
        $Ingre23 = mysql_query($QuerryInsert23);
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Menu</title>
        <script type="text/javascript" src="Aplicacion_Java/prototype.js"></script>
        <script type="text/javascript">
            function eliPadre(fe){
                if(confirm("Seguro que desea eliminar el registro Padre")){
                    var p="fe="+fe;
                    var a=new Ajax.Request('untitled.php',{parameters:p, method:'get',onComplete:function(){
                            document.location.href='Eliminar_padre.php'
                        }});
                    
                }
            }
            function ingreHijo(fe){
                var p="fe="+fe;
                var a=new Ajax.Request('SeectMen.php',{parameters:p, method:'get',onComplete:function(r){
                        var a=new Ajax.Updater('NvoMov','SelectPadre.php')
                    }});
                
            }
            function MODingreHijo(fe){
                var p="fe="+fe+".4";
                var a=new Ajax.Request('untitled.php',{parameters:p, method:'get',onComplete:function(){
                        document.location.href='ModIngresoHijo.php'
                    }});
                
            }
            function MODingrePADRE(fe){
                var p="fe="+fe+".5";
                var a=new Ajax.Request('untitled.php',{parameters:p, method:'get', onComplete:function(){
                        document.location.href='ModIngresoSUBHijo.php'
                    }});
                
            }
            function ingreSubHijo(fe){
                var p="fe="+fe;
                var a=new Ajax.Request('untitled.php',{parameters:p, method:'get', onComplete:function(){
                        document.location.href='IngresoSubHijo.php'
                    }});
                
            }
        </script>
        <link href="../../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
        <link href="../../css/ContentStyle.css" rel="stylesheet" type="text/css" />
    </head>
    <?php
    $_SESSION['Perfil'] = $Usue;
    if ($Usue != "") {
        $_SESSION["UsuSelect"] = $Usue;
        ?>
        <script type="text/javascript">
            var a=new Ajax.Updater('NvoMov','SelectPadre.php',{evalScripts:true});
        </script>
        <?PHP
    }
    ?>
    <body>
        <form id="form1" name="form1" method="get" action="SelectMenu1.php">
            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="">
                <tr align="left">
                    <th width="45" height="41"><ul class="nav nav-tabs"><li class="active" style="font-weight: bolder"><a>Perfil:
                        <?php
                        if( !$Usue == "" ) {
                            $Querry_recordSetRECU = "select * from cllg_perfil where ID = '$Usue'";
                            $recordsetRECU = mysql_query($Querry_recordSetRECU) or die(mysql_error());
                            $pruebaRECU = mysql_fetch_assoc($recordsetRECU);
                            $nomr = $pruebaRECU["NAME"];
                            echo $nomr;
                        }
                        ?>
                                    
                    </a></li></ul></th></tr>
                <tr>
                    <th width="470" valign="middle">
                        <input name="BTusu" type="button" class="btn btn-info" id="BTusu" value="Regresar" onclick="javascript:parent.loadpantalla('modules/perfiles/')" />
                    </th>
                </tr>

            </table>
        </form>
        &nbsp;
        <div id="NvoMov">&nbsp;</div>		

    </body>
</html>
